package com.highcom.mapper;

import com.highcom.bean.Student;
import com.highcom.sql.ReturnSql;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface StudentMapper {

    //@Select("select * from student")
    @SelectProvider(type = ReturnSql.class, method = "getSelectAll")
    public List<Student> selectAll();

    //根据id 查学生
    @SelectProvider(type = ReturnSql.class, method = "getSelectById")
    public Student selectById(Integer id);


    //添加学生
    @SelectProvider(type = ReturnSql.class, method = "insertStudent")
    public Integer insert(Student student);


//    @Insert("insert into student values (#{id},#{name},#{age})")
//    public Integer insert2(@Param("id")Integer id,@Param("name")String name,@Param("age")Integer age);

    //删除学生
    @SelectProvider(type = ReturnSql.class,method = "deleteStudent")
    public Integer delete(Student student);


    @UpdateProvider(type = ReturnSql.class,method = "updateStudent")
    public Integer update(Student student);
}
